/**
 * CommonUtilities.java
 * Nov 17, 2013
 * Copyright: phongtdse60732@fpt.edu.vn
 */
package DBUltilities;

import java.math.BigInteger;
import java.security.MessageDigest;

/**
 * @author Lubu
 * @version 1.0
 */
public class CommonUtilities {
	public static String MD5 (String input) {
		String md5 = null;
		if (input == null) {
			return null;
		}
		try {
			MessageDigest digest = MessageDigest.getInstance("MD5");
			digest.update(input.getBytes(), 0, input.length());
			md5 = new BigInteger(1, digest.digest()).toString(16);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return md5;
	}
}
